import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';


//引入cookie
import cookie from 'react-cookies'

//引入路由
import * as router from 'react-router-dom'

//引入Antd UI 组件
import * as antd from 'antd'

//引入接口请求
import request from '@/services/request.js'

// 设置全局自定义属性，挂载http对象
React.$HTTP = request

//全局自定义属性，挂载路由对象
React.$router = router

//设置全局自定义属性，挂载cookie对象
React.$cookie = cookie

//设置全局自定义属性，挂载antdUI对象
React.$antd = antd

//如果没有登录就给空对象，如果有登录就给cookie信息
React.$LoginUser = cookie.load('LoginUser') ? cookie.load('LoginUser') : {}


const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  // <React.StrictMode>
    <App />
  // </React.StrictMode>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
